package org.beetl.sql.experimental.iohao.mapper;

import net.sf.cglib.proxy.Callback;
import net.sf.cglib.proxy.CallbackFilter;
import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.mapper.DefaultMapperBuilder;

/**
 * 接口映射构建器, 为了扩展beetlsql注解.就是说可以自定义一些注解来做自己想要的逻辑. <BR>
 * create time : 2017-04-14 15:57
 *
 * @author luoyizhu@gmail.com
 */
@Deprecated
public class FastMapperBuilder extends DefaultMapperBuilder {
    public FastMapperBuilder(SQLManager sqlManager) {
        super(sqlManager);
    }

    public <T> T buildInstance(Class<T> mapperInterface) {
        // 设置代理类与过滤器
        Callback callback = new BeetlMapperInterceptor(sqlManager, mapperInterface, this);
        CallbackFilter filter = MapperCallbackFilter.ME;
        return HancerKit.enhance(mapperInterface, filter, callback);
    }

}
